<!--
 * @Descripttion: 
 * @version: 
 * @Author: xcb
 * @Date: 2021-03-16 09:18:22
 * @LastEditors: yangyongtao
 * @LastEditTime: 2024-03-13 09:34:30
-->
<template>
  <router-view v-slot="{ Component }">
    <div style="height: 100%" v-loading="spinning" element-loading-background="rgba(122, 122, 122, 0.5)">
      <component :is="Component" />
    </div>
  </router-view>
</template>

<script lang="ts">
import { defineComponent, provide, ref } from "vue";
import Cookies from "js-cookie";

export default defineComponent({
  name: "App",
  components: {},
  data() {
    return {};
  },
  setup() {
    Cookies.remove("token");
    // 获取进入当前页面的完整路径
    const href = window.location.href;
    let params = {
      token: "",
    };
    // 判断路径中是否含有?号
    if (href.includes("?")) {
      const link = href.split("?")[1];
      if (link.includes("&")) {
        link.split("&").forEach((item) => {
          let arr = item.split("=");
          params[arr[0]] = arr[1];
        });
      } else {
        let arr = link.split("=");
        params[arr[0]] = arr[1];
      }
      localStorage.setItem('sed-token', params.token)
      Cookies.set("token", params.token);
    } else {
    }
    const spinning = ref<boolean>(false);

    provide("spinning", spinning);

    return {
      spinning,
    };
  },
});
</script>

<style lang="less">
body,
html {
  margin: 0;
  height: 100%;
}

* {
  margin: 0;
}

ul {
  padding: 0;

  li {
    list-style-type: none;
    margin: 0px;
  }
}

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  height: 100%;
  box-sizing: border-box;
  background: url("./assets/home_bg.png");
  background-repeat: repeat;
  background-size: cover;
  padding-top: 68px;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background: #ebeef5;
  box-shadow: inset 1px 0 1px transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: #bcbfc4;
  height: 120px;
}

::-webkit-scrollbar-track {
  box-shadow: inset 0 0 5px transparent;
  border-radius: 2px;
  background: transparent;
}

.left-box::-webkit-scrollbar {
  width: 0px;
}

.ant-btn {
  border-radius: 999999px !important;
}

.stepsIT {
  width: 100%;
  height: 60px;
}

.colorMolel {
  display: inline-block;
  width: 50px;
  height: 24px;
  vertical-align: bottom;
  margin: 0 8px;
}

.zbColor {
  background: #ff0000;
}

.bxColor {
  background: #7030a0;
}

.tsColor {
  background: #00b050;
}

.ybColor {
  background: #ffc000;
}

.zdyColor {
  background: #767171;
}

.dmColor {
  background: #ed7d31;
}

.caoLColor {
  background: #ffc000;
}

.niSColor {
  background: #00b050;
}

.listPro {
  padding-left: 80px;
  padding-right: 16px;
  height: 50px;
  position: relative;

  .xsldName {
    position: absolute;
    left: 10px;
    top: 0;
    line-height: 50px;
  }

  .progressText {
    position: absolute;
    left: 50%;
    top: 25%;
    transform: translate(-50%);
  }
}

.porList {
  height: 90%;
  overflow: auto;
}

.header {
  background: #409eff;
  height: 70px;
  color: white;

  img {
    margin: 11px;
    vertical-align: top;
  }

  h3 {
    display: inline-block;
    line-height: 70px;
    font-size: 28px;
  }
}

.tablePlan {
  .ant-table-body {
    min-height: 340px;
  }
}

.ant-spin-nested-loading {
  height: 100%;

  .ant-spin-container {
    height: 100%;
  }
}

.ant-table-striped .table-striped td {
  background-color: #fafafa;
}

.ant-table-thead>tr>th {
  background-color: #5479b6 !important;
  color: #fff !important;
}

.ant-tabs {
  .ant-tabs-bar {
    margin: 0;
  }

  .ant-tabs-content {
    height: 90%;
  }
}

.ant-slider-dot {
  display: none;
}

.el-tabs__content {
  height: 95%;
}

.roughness-data-card {
  width: 100%;
  height: 330px;
  overflow: hidden;
  position: relative;

  .el-card__header {
    background-color: rgb(56, 159, 221);
    color: #fff;
  }
}

// 处理input type = number的上下箭头
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.el-menu-vertical-demo .el-menu-item {
  height: 56px;
  line-height: 56px;
  font-size: 14px;
  color: #303133;
  padding: 0 20px;
  list-style: none;
  cursor: pointer;
  position: relative;
  transition: border-color 0.3s, background-color 0.3s, color 0.3s;
  box-sizing: border-box;
  white-space: nowrap;
}

.menu-name {
  font-size: 16px !important;
}

.el-menu-vertical-demo .el-menu-item.is-active {
  border-left: 2px solid #1879ff;
  background: linear-gradient(90deg,
      rgba(17, 162, 254, 0.24),
      rgba(70, 176, 241, 0));
  color: #1879ff;
}

.el-menu-vertical-demo .el-menu {
  background-color: hsla(0, 0%, 100%, 0.3) !important;
}

.el-menu-vertical-demo {
  border: none !important;
  background-color: hsla(0, 0%, 100%, 0.3) !important;
}

.ant-tree {
  background: none !important;
  height: 100%;
  overflow: auto;
}

.el-steps--simple {
  background: hsla(0, 0%, 100%, 0.3) !important;
}

// .el-table {
//   background-color: hsla(0, 0%, 100%, 0.3) !important;
//   th.el-table__cell {
//     background-color: hsla(0, 0%, 100%, 0.3) !important;
//   }
// }

.el-card {
  background-color: rgba(255, 255, 255, 0.4) !important;
}

.el-card__body {
  height: 100%;
  // padding: 20px 10px 20px 10px !important;
}

.el-main {
  background: none !important;
}

.el-message {
  top: 90px !important;
}

.el-slider__stop {
  display: none;
}

.el-scrollbar__bar.is-vertical {
  width: 0 !important;
}</style>
